package br.com.estevam.sisfin.daos;

import org.apache.tapestry5.hibernate.HibernateSessionManager;
import org.apache.tapestry5.services.ApplicationStateManager;
import org.hibernate.Criteria;

import br.com.estevam.sisfin.daos.interfaces.PessoalDAO;
import br.com.estevam.sisfin.entities.Pessoal;

public class PessoalDAOImpl extends AbstractDAOImpl implements PessoalDAO {

	public PessoalDAOImpl(HibernateSessionManager hsm, ApplicationStateManager asm) {
		super(hsm, asm, Pessoal.class);
	}

	public Pessoal findByCpf(String cpf) {
		Criteria c = createCriteria();
		c = addEqRestriction(c, "cpf", cpf);
		return (Pessoal) c.uniqueResult();
	}

}
